package ferp.core.ai.nn.bp.activation;

/**
 * User: igorgok
 * Date: 12/2/13 3:42 PM
 */
public class Threshold implements Activation
{
  public Threshold(double threshold)
  {
    this.threshold = threshold;
  }

  @Override
  public double activate(double d)
  {
    return d > threshold ? 1 : 0;
  }

  @Override
  public double derivative(double d)
  {
    return 0;
  }

  private final double threshold;
}
